package com.sen;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

/**
 * @author ：linsir
 * @date ：Created in 2021/6/21 11:00
 * @description：基础编码启动
 * @modified By：
 * @version: 1.0.0
 */

@SpringBootApplication
@EnableDiscoveryClient
@MapperScan("com.sen.basecode.mapper")
public class BaseCodeApplication implements ApplicationListener<ContextRefreshedEvent> {


    public static void main(String[] args) {
        if(args.length!=0){
            System.setProperty("spring.profiles.active",args[0]);
        }
        SpringApplication.run(BaseCodeApplication.class,args);
    }

    /**
     * 系统启动，出发实践
     * @param contextRefreshedEvent
     */
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {

        //TODO 系统初始化时候，执行
    }
}
